Class org.omg.CORBA.ServerRequest
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.omg.CORBA.ServerRequest

java.lang.Object
   |
   +----org.omg.CORBA.ServerRequest

public class ServerRequest
extends Object
The ServerRequest pseudo-object is the cornerstone of the ORB Dynamic Skeleton Interface (DSI). It captures the explicit state of a request for the DSI, analogous to the Request pseudo object in the DII.

The ORB is responsible for creating this embodiment of a request, and delivering it to a Dynamic Implementation Routine (DIR). This is an instance of the DynamicImplementation interface. A dynamic servant is created by implementing the DynamicImplementation interface, which has a single invoke operation that accepts a ServerRequest.

The ServerRequest interface defines operations to access the operation name, the arguments and the context of the request, as well as operations to set the response of the request either as a result or an exception.

A subtlety with accessing the arguments of the request is that the DynamicImplementation needs to provide type information about the expected arguments, since there is no compiled information about these. This information is provided through an NVList, which is a list of NamedValues. Each NamedValue contains an Any that has a TypeCode representing the type of the corresponding argument.

Similarly, type information needs to be provided for the response, for either the expected result or for an exception.

See Also:
DynamicImplementation, NVList, NamedValue

Constructor Index

 o ServerRequest()

Method Index

 o ctx()
When the operation is not an attribute access, ctx will return the context information defined in OMG IDL for operation (if any).
 o except(Any)
To report an exception, rather than provide return values, the DIR provides the exception value inside an Any, and passes that to exception().
 o op_name()
The op_name operation returns the name of the operation being invoked; according to OMG IDL's rules, these names must be unique among all operations supported by this object's "most-derived" interface.
 o params(NVList)
Operation parameters will be retrieved with params.
 o result(Any)
The result operation is used to find where to store any return value for the call.

Constructors

 o ServerRequest
  public ServerRequest()

Methods

 o op_name
  public abstract String op_name() throws SystemException
The op_name operation returns the name of the operation being invoked; according to OMG IDL's rules, these names must be unique among all operations supported by this object's "most-derived" interface. Note that the opertion names for getting and setting attributes are _get_ and _set_, respectively.
Returns:
the name of the operation to be invoked
 o params
  public abstract void params(NVList params) throws SystemException
Operation parameters will be retrieved with params. They appear in the NVList in the order in which they appear in the OMG IDL specification (left to right). This holds the "in", "out" and "inout" values.

The ServerRequest provides parameter values when the DIR invokes the params() operation. The NVList provided by the DIR to the ORB includes the TypeCodes (inside a NamedValue) for all parameters, including out ones (their values are nulls at first), for the operation. This allows the ORB to verify that the correct parameter types have been provided before filling their values in, but does not require it to do so. It also relieves the ORB of all responsibility to consult the interface repository, promoting high performance implementations.

In order to guarantee that the ORB could always verify parameter lists, and to detect errors such as omitted parameters, Dynamic Implementation Routines are always required to call params(), even when the DIR believes that no parameters are used by the operation. When the DIR believes no parameters are used by the operation, it passes an empty NVList.

The params() and result() operations may be called only once, and in that exact order. A violation results in the BAD_OPERATION exception being thrown.

Parameters:
params - the arguments of the operation, in the form of an NVList.
 o result
  public abstract void result(Any result) throws SystemException
The result operation is used to find where to store any return value for the call.

The ServerRequest will not send a response to the invocation until the DIR returns. If a return value is required, the result() operation must be invoked to provide that value to the ORB. Where no return value is required, this need not be invoked.

The params() and result() operations may be called only once, and in that exact order. A violation results in the BAD_OPERATION exception being thrown.

Parameters:
result - the Any in which the result is stored.
 o except
  public abstract void except(Any exc) throws SystemException
To report an exception, rather than provide return values, the DIR provides the exception value inside an Any, and passes that to exception().

The exception() routine can be called only once, after params() is called. It may not be called if result() has been called. A violation results in the BAD_OPERATION exception being thrown.

Parameters:
exc - the Any containing the exception.
 o ctx
  public abstract Context ctx() throws SystemException
When the operation is not an attribute access, ctx will return the context information defined in OMG IDL for operation (if any). Otherwise, this context is empty.
Returns:
the context object that is to be used to resolve any context strings whose values need to be sent with the invocation.

All Packages  Class Hierarchy  This Package  Previous  Next  Index